﻿<UserControl x:Class="GiveAQuiz.Questions.MultipleChoiceAnswerControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="400">

  <Grid x:Name="LayoutRoot"
        Background="White">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <RichTextBox TextWrapping="Wrap"
                 IsReadOnly="True"
                 BorderThickness="0"
                 Margin="2 0"
                 x:Name="question">
      <Paragraph>Hello</Paragraph>
    </RichTextBox>

    <ItemsControl Margin="2,2,2,8"
                  ItemsSource="{Binding Answers, NotifyOnValidationError=True}"
                  Grid.Row="1"
                  BorderThickness="1"
                  MinHeight="50"
                  VerticalAlignment="Top">
      <ItemsControl.ItemTemplate>
        <DataTemplate>
          <Grid>
            <RadioButton IsChecked="{Binding IsCorrectChoice, Mode=TwoWay}"
                         Checked="RadioButton_Checked"
                         Margin="0 4">
              <TextBlock TextWrapping="Wrap"
                         Text="{Binding ChoiceText}" />
            </RadioButton>
          </Grid>
        </DataTemplate>
      </ItemsControl.ItemTemplate>
    </ItemsControl>
    <sdk:ValidationSummary d:LayoutOverrides="Width, Height"
                           Grid.Row="2" />
  </Grid>
</UserControl>
